[PHP] How to pass array as multiple parameters to function?
Posted
by vbklv
on Stack Overflow
See other posts from Stack Overflow
or by vbklv
Published on 2010-04-27T10:20:22Z
Indexed on
2010/04/27
10:23 UTC
Read the original article
Hit count: 203
I have a parameters array:
$params[1] = 'param1';
$params[2] = 'param2';
$params[3] = 'param3';
...
$params[N] = 'paramN';
I have a caller to various functions:
$method->$function( $params );
How can I parse the $params array, so multiple (and unlimited) parameters can be passed to any function:
$method->$function( $param[1], $param[2], ..., $param[N] );
© Stack Overflow or respective owner